import { i18nRender } from '@/locales'

export const IS_DEFAULT = {
  DEFAULT: {
    value: 1,
    desc: i18nRender('all.autotext358')
  },
  UNDEFAULT: {
    value: 0,
    desc: i18nRender('all.autotext1429')
  }
}
export const APPROVAL_FILE = {
  YES: {
    value: 1,
    desc: i18nRender('all.autotext279')
  },
  NO: {
    value: 0,
    desc: i18nRender('all.autotext263')
  }
}

export const STATUS = {
  DAISHENHE: {
    value: 1,
    desc: i18nRender('all.autotext934')
  },
  DAIFUKUAN: {
    value: 2,
    desc: i18nRender('all.autotext407')
  },
  DAIWANSHUI: {
    value: 3,
    desc: i18nRender('all.autotext138')
  },
  WANCHENG: {
    value: 4,
    desc: i18nRender('all.autotext538')
  },
  BOHUI: {
    value: 5,
    desc: i18nRender('all.autotext300')
  }
}

export const ROLE_LIST = {
  DIRECTOR: {
    value: 1,
    desc: i18nRender('all.autotext435')
  },
  MEMBER: {
    value: 2,
    desc: i18nRender('all.autotext637')
  },
  SUBJECT: {
    value: 3,
    desc: i18nRender('all.autotext446')
  },
  RESEARCH: {
    value: 4,
    desc: i18nRender('all.autotext949')
  }
}

export const USER_TYPE = {
  GEREN: {
    value: 1,
    desc: i18nRender('all.autotext259'),
    color: 'F50'
  },
  ZUZHI: {
    value: 2,
    desc: i18nRender('all.autotext1175')
  }
}

export const APPLY_COST_TYPE = {
  RESEARCH: {
    value: 1,
    desc: i18nRender('all.autotext1096')
  },
  SUBJECT: {
    value: 2,
    desc: i18nRender('all.autotext446')
  }
}

/* 审批状态 1：30:待审批  41:通过(财务角色-待完税)  50:待付款  60:已完成 */
// 待审核30、审核撤回-11、审核中31、审核驳回-1、审核结束70、待报税41、支付中51、打款失败50、已完成60、已关闭-12
export const EXAMINE_TYPE = {
  WAITCOMMIT: {
    value: 30,
    desc: i18nRender('all.autotext1685')
  },
  WAITPROOF: {
    value: -11,
    desc: i18nRender('all.autotext1663')
  },
  WAITAPPROVE: {
    value: 31,
    desc: i18nRender('all.autotext230')
  },
  CHECKING: {
    value: -1,
    desc: i18nRender('all.autotext871')
  },
  REFUSE: {
    value: 70,
    desc: i18nRender('all.autotext1686')
  },
  // PASSTAX: {
  //   value: 41,
  //   desc: i18nRender('all.autotext1496')
  // },
  DAIZHIFU: {
    value: 50,
    desc: i18nRender('all.autotext1664')
  },
  PAYINT: {
    value: 51,
    desc: i18nRender('all.autotext681')
  },
  YIWANCHENG: {
    value: 60,
    desc: i18nRender('all.autotext6')
  },
  additionalinformation: {
    value: 20,
    desc: i18nRender('all.autotext476')
  },
  CLOSE: {
    value: -12,
    desc: i18nRender('all.autotext1929')
  }
}

export const PROJECT_ADMIN = [
  {
    value: '30,31,41,50,51,60,-1,-11,70,-12',
    desc: i18nRender('all.autotext600')
  },
  {
    value: 30,
    desc: i18nRender('all.autotext934')
  },
  {
    value: -1,
    desc: i18nRender('all.autotext871')
  },
  {
    value: 51,
    desc: '支付中'
  },
  {
    value: 50,
    desc: '付款失败'
  },
  {
    value: 60,
    desc: '已完成'
  }
  
]

// 申请人: 全部，待审核，审核驳回, 审核通过
export const APPLIER_STATUS = [
  {
    value: '30,31,41,50,51,60,-1,-11,70,-12',
    desc: i18nRender('all.autotext600')
  },
  {
    value: 30,
    desc: i18nRender('all.autotext934')
  },
  {
    value: -1,
    desc: i18nRender('all.autotext871')
  },
  {
    value: '31,41,50,51,60',
    desc: i18nRender('all.autotext1281')
  },
  {
    value: 70,
    desc: i18nRender('all.autotext1530')
  }
]

// 财务
export const FINANCE_STATUS = [
  {
    value: '30,31,41,50,51,60,-1,-11,70,-12',
    desc: i18nRender('all.autotext600')
  },
  {
    value: 30,
    desc: i18nRender('all.autotext934')
  },
  {
    value: -1,
    desc: i18nRender('all.autotext871')
  },
  {
    value: 41,
    desc: i18nRender('all.autotext138')
  },
  {
    value: 51,
    desc: i18nRender('all.autotext681')
  },
  {
    value: 50,
    desc: i18nRender('all.autotext499')
  },
  {
    value: 60,
    desc: i18nRender('all.autotext6')
  },
  {
    value: 70,
    desc: i18nRender('all.autotext1530')
  }
]

// 申请人搜索条件
export const APPLY_QUERY_STATUS = [
  {
    value: 20,
    desc: i18nRender('all.autotext302')
  },
  {
    value: '30,31',
    desc: i18nRender('all.autotext230')
  },
  {
    value: -1,
    desc: i18nRender('all.autotext871')
  },
  {
    value: 41,
    desc: i18nRender('all.autotext138')
  },
  {
    value: '50,51',
    desc: i18nRender('all.autotext39')
  },
  {
    value: 60,
    desc: i18nRender('all.autotext6')
  },
  {
    value: -11,
    desc: i18nRender('all.autotext810')
  },
  {
    value: 70,
    desc: i18nRender('all.autotext1530')
  }
]

export const ENUMERATION = {
  DAISHENHE: {
    value: 1,
    desc: i18nRender('all.autotext656')
  },
  DAIFUKUAN: {
    value: 2,
    desc: i18nRender('all.autotext379')
  },
  DAIWANSHUI: {
    value: 3,
    desc: i18nRender('all.autotext1411')
  },
  BAOSHUIZHONG: {
    value: 4,
    desc: i18nRender('all.autotext30')
  },
  YIWANCHENG: {
    value: 5,
    desc: i18nRender('all.autotext526')
  },
  DAIPISHENHE: {
    value: 3,
    desc: i18nRender('all.autotext990')
  },
  DAIZHIFU: {
    value: 4,
    desc: i18nRender('all.autotext1014')
  }
}

// 30:待审批  41:通过(财务角色-待完税)  50:待付款  60:已完成

export const CAIWU_STATUS = {
  DAISHENGPI: {
    value: 30,
    desc: i18nRender('all.autotext588')
  },
  DAIWANSHUI: {
    value: 2,
    desc: i18nRender('all.autotext138')
  },
  DAIFUKUAN: {
    value: 50,
    desc: i18nRender('all.autotext407')
  },
  WANCHENG: {
    value: 60,
    desc: i18nRender('all.autotext1152')
  },
  BOHUI: {
    value: 5,
    desc: i18nRender('all.autotext515')
  }
}

export const SUBJECTANDREESA = {
  DAISHENGPI: {
    value: 1,
    desc: i18nRender('all.autotext1096'),
    auth: 'PAY_SITUATION_RESEARCHER'
  },
  DAIWANSHUI: {
    value: 2,
    desc: i18nRender('all.autotext446'),
    auth: 'PAY_SITUATION_PATIENT'
  }
}

export const SYSTEM_TYPE = {
  PAYMENT: {
    value: 1,
    desc: 'Payment'
  },
  CONSENT: {
    value: 2,
    desc: 'Consent'
  },
  SOURCE: {
    value: 3,
    desc: 'Source'
  },
  MP: {
    value: 4,
    desc: i18nRender('all.autotext1317')
  },
  PAD: {
    value: 5,
    desc: 'Pad'
  }
}

export const EVENT_TYPE = {
  CLICK: {
    value: 1,
    desc: i18nRender('all.autotext1168')
  },
  BROWSER: {
    value: 2,
    desc: i18nRender('all.autotext284')
  }
}

export const DOMAIN_TYPE = {
  PC: {
    value: 'PC',
    desc: 'PC'
  },
  MP: {
    value: 'MP',
    desc: i18nRender('all.autotext1317')
  },
  PAD: {
    value: 'PAD',
    desc: 'Pad'
  }
}
export const DOMAIN_TYPE_LIST = {
  PC: {
    value: 1,
    desc: 'PC'
  },
  MP: {
    value: 2,
    desc: i18nRender('all.autotext1317')
  },
  PAD: {
    value: 3,
    desc: 'Pad'
  }
}

export const FEE_CHECK_STATUS = {
  WAIT: {
    value: 0,
    desc: i18nRender('all.autotext609') // 待处理
  },
  ADOPT: {
    value: 1,
    desc: i18nRender('all.autotext130') // 通过
  },
  SUBMIT: {
    value: 2,
    desc: i18nRender('all.autotext1135')
  },
  SUBMIT_EXTRA: {
    value: 3,
    desc: i18nRender('all.autotext1288')
  },
  SUBMIT_TAX: {
    value: 4,
    desc: i18nRender('all.autotext886')
  },
  SUBMIT_3: {
    value: 5,
    desc: i18nRender('all.autotext271')
  },
  PAYING: {
    value: 6,
    desc: i18nRender('all.autotext115')
  },
  PAYED: {
    value: 7,
    desc: i18nRender('all.autotext79')
  },
  REJECT: {
    value: -1,
    desc: i18nRender('all.autotext1072') // 拒绝
  },
  FAIL: {
    value: -2,
    desc: i18nRender('all.autotext499')
  },
  BACK: {
    value: -11,
    desc: i18nRender('all.autotext1182')
  },
  MIDDELADOPT: {
    value: 100,
    desc: i18nRender('all.autotext1826') // 通过，与ADOPT是一样的，只是审批进度中间的英文表达不一样，中午都一样
  },
  MIDDELREJECT: {
    value: -100,
    desc: i18nRender('all.autotext1827') // 拒绝，与REJECT是一样的，只是审批进度中间的英文表达不一样，中午都一样
  },
  CLOSE: {
    value: -12,
    desc: '已关闭'
  }
}
export const APPROVAL_STATUS = {
  WAIT: {
    value: 10,
    desc: i18nRender('all.autotext1080')
  },
  ADOPT: {
    value: 20,
    desc: i18nRender('all.autotext476')
  },
  NO_APPROVAL: {
    value: 30,
    desc: i18nRender('all.autotext934')
  },
  APPROVAL: {
    value: 31,
    desc: i18nRender('all.autotext230')
  },
  PASS_TAX: {
    value: 41,
    desc: i18nRender('all.autotext1496')
  },
  NO_PAY: {
    value: 50,
    desc: i18nRender('all.autotext407')
  },
  PAYING: {
    value: 51,
    desc: i18nRender('all.autotext115')
  },
  COMPLETED: {
    value: 60,
    desc: i18nRender('all.autotext6')
  },
  REJECT: {
    value: -1,
    desc: i18nRender('all.autotext1010')
  }
}

export const INVITE_STATUS = {
  INVITE: {
    value: 1,
    desc: i18nRender('all.autotext1026')
  },
  COMPLETED: {
    value: 2,
    desc: i18nRender('all.autotext1415')
  }
}
export const PROJECT_STATUS = {
  NO_START: {
    value: 1,
    color: 'blue',
    desc: i18nRender('all.autotext392')
  },
  GOING: {
    value: 2,
    color: 'green',
    desc: i18nRender('all.autotext1075')
  },
  CLOSED: {
    value: 3,
    color: '',
    desc: i18nRender('all.autotext1410')
  }
}
export const ACTION_TYPE = {
  VIEW: {
    value: 'QUERY',
    desc: i18nRender('all.autotext30')
  },
  ADD: {
    value: 'ADD',
    desc: i18nRender('all.autotext409')
  },
  UPDATE: {
    value: 'UPDATE',
    desc: i18nRender('all.autotext919')
  },
  DELETE: {
    value: 'DELETE',
    desc: i18nRender('all.autotext379')
  },
  EXPORT: {
    value: 'EXPORT',
    desc: i18nRender('all.autotext1014')
  },
  IMPORT: {
    value: 'IMPORT',
    desc: i18nRender('all.autotext990')
  },
  LOGIN: {
    value: 'LOGIN',
    desc: i18nRender('all.autotext1154')
  },
  LOGOUT: {
    value: 'EXIT',
    desc: i18nRender('all.autotext86')
  },
  JOIN: {
    value: 'JOIN',
    desc: i18nRender('all.autotext891')
  },
  APPROVAL: {
    value: 'APPROVAL',
    desc: i18nRender('all.autotext1299')
  },
  TRANSACT: {
    value: 'TRANSACT',
    desc: i18nRender('all.autotext1304')
  }
}

export const FILE_TYPE = {
  IMAGE: {
    value: 1,
    desc: i18nRender('all.autotext1302')
  },
  PDF: {
    value: 2,
    desc: 'pdf ' + i18nRender('all.autotext942')
  },
  DOC: {
    value: 3,
    desc: 'doc ' + i18nRender('all.autotext942')
  }
}

export const COMMON_ROLE_TYPE = {
  TESTEE: {
    value: 2,
    desc: i18nRender('all.autotext446')
  },
  RESEARCHER: {
    value: 1,
    desc: i18nRender('all.autotext1096')
  }
}


export const COMMON_ROLE_PERMISSION_PRO_CODE = [
  'PROJECT_ADMIN', 'CRC', 'PM', 'CRA', 'Investigator', 'Subjects', i18nRender('all.autotext579')
]

export const COMMON_ROLE_PERMISSION_SYS_CODE = [
  'SYS_ADMIN', 'SYS_BIZ', 'SYS_FINANCE', i18nRender('all.autotext579'), 'PROJECT_ADMIN'
]

export const COMMON_OPERATION_TYPE_LIST = [
  i18nRender('all.autotext409'),
  i18nRender('all.autotext568'),
  i18nRender('all.autotext919'),
  i18nRender('all.autotext379'),
  i18nRender('all.autotext990'),
  i18nRender('all.autotext184'),
  i18nRender('all.autotext121'),
  i18nRender('all.autotext101'),
  i18nRender('all.autotext1285'),
  i18nRender('all.autotext1805'),
  i18nRender('all.autotext1806')
]

export const UPLOAD_FILE_TYPE = {
  FEE_DETAIL: {
    value: 1,
    desc: i18nRender('all.autotext12')
  },
  TAX_RECEIPT: {
    value: 2,
    desc: i18nRender('all.autotext512')
  }
}

export const BANK_TYPE = {
  BANK: {
    value: 1,
    desc: i18nRender('all.autotext283')
  },
  DIGITAL: {
    value: 2,
    desc: i18nRender('all.autotext1750')
  }
}

export const AUTHORIZATION_TYPE = {
  BANK: {
    value: 1,
    desc: i18nRender('all.autotext446')
  },
  DIGITAL: {
    value: 2,
    desc: i18nRender('subject.autotext2')
  },
  PICRC: {
    value: 3,
    desc: 'PI/CRC'
  }
}

export const OFFLINE_TYPE = {
  ON: {
    value: 1,
    desc: i18nRender('all.autotext1548')
  },
  OFF: {
    value: 2,
    desc: i18nRender('all.autotext1531')
  }
}

export default {
  APPROVAL_FILE,
  IS_DEFAULT,
  STATUS,
  ROLE_LIST,
  USER_TYPE,
  APPLY_COST_TYPE,
  EXAMINE_TYPE,
  ENUMERATION,
  CAIWU_STATUS,
  SUBJECTANDREESA,
  SYSTEM_TYPE,
  DOMAIN_TYPE,
  EVENT_TYPE,
  FEE_CHECK_STATUS,
  APPROVAL_STATUS,
  INVITE_STATUS,
  DOMAIN_TYPE_LIST,
  PROJECT_STATUS,
  ACTION_TYPE,
  FILE_TYPE,
  COMMON_ROLE_TYPE,
  COMMON_OPERATION_TYPE_LIST,
  COMMON_ROLE_PERMISSION_PRO_CODE,
  COMMON_ROLE_PERMISSION_SYS_CODE,
  UPLOAD_FILE_TYPE,
  BANK_TYPE,
  AUTHORIZATION_TYPE,
  OFFLINE_TYPE
}
